'''
Created on 2009-4-17

@author: Administrator
'''
import unittest
from com.carnation.common.util.test import testTools


class Test(unittest.TestCase):


    def testCreateGroup(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(1, 'Run For Test SecurityService.createGroup', \
'''
com.carnation.mong.platform.service.SecurityService.createGroup
    com.carnation.mong.platform.um.Group
        setId    111L
        setName    "group"
    java.util.List
        0
            com.carnation.mong.platform.um.User
                setId    222L
                setName    "admin"
        1
            com.carnation.mong.platform.um.User
                setId    333L
                setName    "tester"
    java.util.List
        0
            com.carnation.mong.platform.um.Role
                setId    111L
                setName    "Administrators"
        1
            com.carnation.mong.platform.um.Role
                setId    222L
                setName    "Guest"
''', \
'''
Group
    getId    111L
    getName    ""
'''
)
#    print rsp_msg
        print '\nDone'
        test.quit()

    def testCreateGroupById(self):
        test = testTools(__file__) 
        rsp_msg = test.requestAndRsp(1, 'Run For Test SecurityService.createGroupById', \
'''
com.carnation.mong.platform.service.SecurityService.createGroupById
    com.carnation.mong.platform.um.Group
        setId    111L
        setName    "group"
    java.util.List
        0
            111L
        1
            222L
    java.util.List
        0
            111L
        1
            222L
''', \
'''
Group
    getId    111L
    getName    "group"
'''
)
#    print rsp_msg
        print '\nDone'
        test.quit()

if __name__ == "__main__":
    unittest.main()
